﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PTTK_HTTT_06.BUS;
using System.Data.SqlClient;

namespace PTTK_HTTT_06.DAO
{
    class CT_YC_XUAT_NGUYEN_LIEU_DB
    {
        public static int ThemCTYCNL(CT_YC_XUAT_NGUYEN_LIEU ctycnl)
        {
            DataProvider dataProvider = new DataProvider();

            List<SqlParameter> parameterList = new List<SqlParameter>();
            parameterList.Add(new SqlParameter("MaYCXuatNguyenLieu", ctycnl.MaYCXuatNguyenLieu));
            parameterList.Add(new SqlParameter("MaNguyenLieu", ctycnl.MaNL));
            parameterList.Add(new SqlParameter("SoLuong", ctycnl.SoLuong));


            int num = -1;
            if (!dataProvider.IsConnect())
                dataProvider.Connect();
            num = dataProvider.ExcuteProcedureWithReturn("ThemCTYCNL", parameterList.ToArray());
            dataProvider.Disconnect();

            return num;
        }
    }
}
